import request from "@/util/request.js";

export function userLogin(loginForm) {
    return request({
        url: '/system/login',
        method: 'post',
        data: loginForm
    })
}
export function reqUserRegister(registerForm) {
    return request({
        url: '/system/register',
        method: 'post',
        data: registerForm
    })
}
export function reqUserLogout() {
    return request({
        url: '/system/logout',
        method: 'post',
    })
}
export function reqGetUserInfo() {
    return request({
        url: '/system/info',
        method: 'get',
    })
}
export function reqGetUserPage(params) {
    return request({
        url: '/system/user/page',
        method: 'get',
        params
    })
}
export function reqUpdateUser(data) {
    return request({
        url: '/system/info',
        method: 'put',
        data
    })
}
export function reqCreateUser(data) {
    return request({
        url: '/system/user',
        method: 'post',
        data
    })
}
export function reqDeleteUserById(id) {
    return request({
        url: '/system/user/' + id,
        method: 'delete',
    })
}

export function reqGetOnlineCount() {
    return request({
        url: '/system/user/online/count',
        method: 'get',
    })
}
